<template>
    <a-spin :spinning="$store.getters.getLoading">
        <a-locale-provider :locale="zh_CN">
            <router-view style="height: 100%;" />
        </a-locale-provider>
    </a-spin>
</template>

<script>
    import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
    export default {
        data() {
            return {
                zh_CN,
            };
        },
        mounted(){
            //  绑定页面重新加载事件
            window.addEventListener('unload',this.saveState);
        },
        methods : {
            saveState(){
                sessionStorage.setItem('user_state',JSON.stringify(this.$store.state.user));
            }
        }
    };
</script>
